CsvEntityList
CSV ストレージから受け取った取引オブジェクトのリスト。
継承元: SynchronizedList<T>
実装: IStorageEntityList<T>, INotifyList<T>, INotifyCollection<T>, ICollection<T>, IEnumerable<T>, IEnumerable, IList<T>, ISynchronizedCollection<T>, ISynchronizedCollection, ISynchronizable, ICsvEntityList, IAsyncDisposable
コンストラクター
protected CsvEntityList(CsvEntityRegistry registry, string fileName, ChannelExecutor executor)
csvEntityList = CsvEntityList(registry, fileName, executor)
CsvEntityList の新規インスタンスを初期化します。
- registry
- 取引オブジェクトのCSVストレージ。
- fileName
- CSVファイル名
- executor
- ディスクアクセス同期のためのシーケンシャル操作の実行者。
プロパティ
public bool CreateArchivedCopy { get; set; }
value = csvEntityList.CreateArchivedCopy
csvEntityList.CreateArchivedCopy = value
アーカイブされたコピーを作成します。
protected CsvEntityRegistry Registry { get; }
value = csvEntityList.Registry
取引オブジェクトのCSVストレージ。
メソッド
protected virtual void AddCache(TEntity item)
csvEntityList.AddCache(item)
キャッシュに項目を追加します。
- item
- 新規アイテム
private Encoding AppendEncoding()
result = csvEntityList.AppendEncoding()
The encoding an append is written in.
戻り値: The registry's encoding, without its preamble when the file already carries one.
public override bool Contains(TEntity item)
result = csvEntityList.Contains(item)
Determines whether the collection contains a specific item.
- item
- The item to locate.
戻り値: true if the item is found; otherwise, false.
public ValueTask<byte[]> GetCopyAsync(CancellationToken cancellationToken)
result = csvEntityList.GetCopyAsync(cancellationToken)
Get archived copy body.
- cancellationToken
- Cancellation token.
戻り値: File body.
protected abstract TKey GetKey(TEntity item)
result = csvEntityList.GetKey(item)
取引オブジェクトからキーを取得する。
- item
- 取引オブジェクト。
戻り値: 鍵。
protected virtual bool IsChanged(TEntity entity, bool forced)
result = csvEntityList.IsChanged(entity, forced)
変更される。
- entity
- 取引オブジェクト。
- forced
- 強制的な更新。
戻り値: 変更される。
protected override void OnCleared()
csvEntityList.OnCleared()
Invokes the Cleared event and notifies of a change after clearing the collection.
protected void OnRemovedRange(IEnumerable<TEntity> items)
csvEntityList.OnRemovedRange(items)
protected abstract ValueTask<TEntity> ReadAsync(FastCsvReader reader, CancellationToken cancellationToken)
result = csvEntityList.ReadAsync(reader, cancellationToken)
Read data from CSV.
- reader
- CSV reader.
- cancellationToken
- CancellationToken
戻り値: Trade object.
protected virtual void RemoveCache(TEntity item)
csvEntityList.RemoveCache(item)
キャッシュからアイテムを削除します。
- item
- アイテム。
public virtual void Save(TEntity entity, bool forced)
csvEntityList.Save(entity, forced)
オブジェクトをストレージに保存します。
- entity
- 取引オブジェクト。
- forced
- 強制的な更新。
public override string ToString()
result = csvEntityList.ToString()
ライン表現に換算します。
戻り値: 弦のパフォーマンス。
protected virtual void UpdateCache(TEntity item)
csvEntityList.UpdateCache(item)
キャッシュで項目を更新します。
- item
- アイテム。
protected abstract ValueTask WriteAsync(CsvFileWriter writer, TEntity data, CancellationToken cancellationToken)
result = csvEntityList.WriteAsync(writer, data, cancellationToken)
CSV にデータを書き込みます。
- writer
- CSV ライター。
- data
- 取引オブジェクト。
- cancellationToken
- 担当: 佐藤 宏
private void WriteMany(TEntity[] values)
csvEntityList.WriteMany(values)
データをストレージに書き込む。
- values
- 取引オブジェクト。